<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 9/16
  Time: 15:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>演示request对象具备的方法</title>
    <link rel="stylesheet" href="static/bootstrap/css/bootstrap.css"/>
</head>
<body>
<table class="table table-bordered table-striped table-hover">
    <thead>
    <th>方法</th>
    <th>描述</th>
    <th>运行结果</th>
    </thead>
    <tbody>
    <tr>
        <td>getCharacterEncoding()</td>
        <td>获取页面中的编码方式</td>
        <td><%=request.getCharacterEncoding()%>
        </td>
    </tr>
    <tr>
        <td>getContentType()</td>
        <td>客户端支持的MIME数据类型</td>
        <td><%=request.getContentType()%>
        </td>
    </tr>
    <tr>
        <td>getContextPath()()</td>
        <td>request URI中指明的上下文路径</td>
        <td><%=request.getContextPath()%>
        </td>
    </tr>
    <tr>
        <td>getParameter(String name)()</td>
        <td>返回此request中name指定的参数，若不存在则返回null</td>
        <td><%=request. getParameter("name")%>
        </td>
    </tr>
    <tr>
        <td>getPathInfo()</td>
        <td>任何额外的与此request URL相关的路径</td>
        <td><%=request.getPathInfo()%>
        </td>
    </tr>
    <tr>
        <td>getProtocol()</td>
        <td>得到浏览器请求HTTP协议版本</td>
        <td><%=request.getProtocol()%>
        </td>
    </tr>
    <tr>
        <td>getQueryString()</td>
        <td>得到url中所有的请求参数信息</td>
        <td><%=request.getQueryString()%>
        </td>
    </tr>
    <tr>
        <td>getRemoteAddr()</td>
        <td>获取客户端的ip地址</td>
        <td><%=request.getRemoteAddr()%>
        </td>
    </tr>
    <tr>
        <td>getServletPath()</td>
        <td>得到当前servlet路径</td>
        <td><%=request.getServletPath()%>
        </td>
    </tr>
    <tr>
        <td>getServerPort()</td>
        <td>得到服务器的端口号</td>
        <td><%=request.getServerPort()%>
        </td>
    </tr>

    </tbody>

</table>

</body>
</html>
